package com.erp.framework.util.user;

public class User implements java.io.Serializable

{
    private String companyCode;
    private String userId;
    private String userName;
    private String roleGroupId;
    private String groupLevel;
    private String userGroupCode;
    private String deptCode;
    private String deptDesc;    

    private boolean accessible = false;

    private boolean modifiable = false;

    private boolean isOwnerOnly = true;

    private boolean isSOD = true;

    private UserDelegate userDg = new UserDelegate();
    
    private String email;

    public User(String companyCode, String userId, String roleGroupId, String groupLevel) {
        this.companyCode = companyCode;
        this.userId = userId;
        this.roleGroupId = roleGroupId;
        this.groupLevel = groupLevel;
    }

    public User(String companyCode, String userId, String userName, String roleGroupId, String groupLevel, String userGroupCode,
            String deptCode, String deptDesc, String email) {
        this.companyCode = companyCode;
        this.userId = userId;
        this.userName = userName;
        this.roleGroupId = roleGroupId;
        this.groupLevel = groupLevel;
        this.userGroupCode = userGroupCode;
        this.deptCode = deptCode;
        this.deptDesc = deptDesc;
        this.email = email;
    }

    public String getCompanyCode() {
        return companyCode;
    }

    public String getUserId() {
        return userId;
    }

    public String getRoleGroupId() {
        return roleGroupId;
    }

    public String getGroupLevel() {
        return groupLevel;
    }

    public void setCompanyCode(String companyCode) {
        this.companyCode = companyCode;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public void setRoleGroupId(String roleGroupId) {
        this.roleGroupId = roleGroupId;
    }

    public void setGroupLevel(String groupLevel) {
        this.groupLevel = groupLevel;
    }

    public boolean hasAccessRight(String companyCode, String userId, String moduleName) {
        // return true;
        // temporary remarked
        return userDg.hasAccessRight(companyCode, userId, moduleName);
    }

    public boolean hasReportRight(String companyCode, String userId, String report) {
        // temporary remarked should implement later
        // return userDg.hasReportRight(companyCode, userId, report);
        return true;
    }

    public String getUserGroupCode() {
        return userGroupCode;
    }

    public void setUserGroupCode(String userGroupCode) {
        this.userGroupCode = userGroupCode;
    }

    public String getDeptCode() {
        return deptCode;
    }

    public void setDeptCode(String deptCode) {
        this.deptCode = deptCode;
    }

    public String getDeptDesc() {
        return deptDesc;
    }

    public void setDeptDesc(String deptDesc) {
        this.deptDesc = deptDesc;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

}